Invoke PowerShell
AutomatR.DefaultActivities.PowerShell.InvokePowerShell
The "Invoke PowerShell" activity in AutomatR allows you to execute PowerShell commands with specified input parameters. This activity leverages the power of PowerShell scripting within your automation workflows.
Properties
Name | Description |
---|---|
Input | |
Command | Specifies the PowerShell command to be executed. The command should be provided as a string. String variables containing the PowerShell command. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Invoke PowerShell" activity. This delay can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 5 seconds, enter 5. |
Output | |
Result | Outputs a collection of PSObject objects representing the result of executing the PowerShell command. This output can be used as input for subsequent activities in the workflow. Collection variables containing PSObject results. |
How to use:
- Drag and drop the "Invoke PowerShell" activity onto the workflow.
- Configure the properties by specifying the PowerShell command to be executed and, optionally, set the delay.
- Execute the workflow to run the specified PowerShell command.
- The output, represented by a collection of PSObject results, can be utilized in subsequent activities within the workflow.
Example:
Consider an example where the "Invoke PowerShell" activity is used to retrieve a list of installed applications on a system:
Invoke PowerShell:
Display Name: "Get Installed Applications"
Params: "Get-WmiObject -Class Win32_Product | Select-Object Name, Version"
Result: installedApplications
In this example, the activity executes the PowerShell command to retrieve information about installed applications. The results, represented as a collection of PSObject objects, are stored in the variable "installedApplications" for further use in the workflow.